//
//  UIBarButtonItem+JTExtension.m
//  百思不得姐
//
//  Created by sun lei on 16/11/17.
//  Copyright © 2016年 BeiJingWangDianJieTong. All rights reserved.
//

#import "UIBarButtonItem+JTExtension.h"

@implementation UIBarButtonItem (JTExtension)

+ (instancetype)jt_itemWithImage:(NSString *)image highLightedImage:(NSString *)highLightedImage target:(id)target action:(SEL)action {
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [button setImage:[UIImage imageNamed:highLightedImage] forState:UIControlStateHighlighted];
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [button sizeToFit];
    return [[self alloc] initWithCustomView:button];
}

@end
